package com.mbc.common.utils;

import javax.persistence.EntityManager;
import javax.persistence.ParameterMode;
import javax.persistence.StoredProcedureQuery;

public class KeyGenerator {	
	public static long generateKey(EntityManager em)throws Exception{
		StoredProcedureQuery l_query = em.createStoredProcedureQuery("sp_ms_key_generate");
		l_query.registerStoredProcedureParameter("param1", Long.class, ParameterMode.OUT);
		l_query.execute();
		return (long)l_query.getOutputParameterValue("param1");
	}
}
